#pragma once
#include <string>
#include <utility>
#include <vector>
#include <list>
#include "skill.h"

//武将基本类
class General {
public:
    enum class Camp:char {
        None,
        WEI,
        WU,
        QUN
    };

    enum class Sex:char {
        None,
        Man,
        Girl
    };

    General() {}
    General(std::string name, std::string desc, int hp, std::vector<Skill*> skills, Camp camp = Camp::None, Sex sex = Sex::None): name(std::move(name)), desc(std::move(desc)), hp(hp),
    camp(camp), sex(sex), skills(std::move(skills)) {}
    General(std::string&& name, std::string&& desc, int hp, std::vector<Skill*>&& skills, Camp camp = Camp::None, Sex sex = Sex::None): name(std::move(name)), desc(std::move(desc)), hp(hp),
    camp(camp), sex(sex), skills(std::move(skills)) {}
    const General& setName(const std::string& x);
    const General& setName(std::string&& x);
    [[nodiscard]] const std::string& getName() const;
    const General& setDesc(const std::string& x);
    const General& setDesc(std::string&& x);
    [[nodiscard]] const std::string& getDesc() const;
    const General& setHp(int x);
    [[nodiscard]] int getHp() const;
    const General& setCamp(Camp c);
    [[nodiscard]] Camp getCamp() const;
    const General& setSex(Sex s);
    [[nodiscard]] Sex getSex() const;
    const General& setSkills(const std::vector<Skill*>& s);
    const General& setSkills(std::vector<Skill*>&& s);
    [[nodiscard]] const std::vector<Skill*>& getSkills() const;

    std::vector<Skill*> findByType(Skill::Type type);
    std::vector<Skill*> findByStage(Skill::Stage stage);
    std::vector<Skill*> findByCondition(Skill::Condition condition);
    ~General();
private:
    std::string name;
    std::string desc;
    //血量
    int hp;
    Camp camp;
    Sex sex;
    //武将技能列表
    std::vector<Skill*> skills;
    void clear();
};
